﻿using System;

namespace zijian666.Converts.Abstractions;

/// <summary>
/// 转换上下文接口
/// </summary>
public interface IConvertContext : IDisposable
{
    /// <summary>
    /// 转换设置
    /// </summary>
    IConvertSettings Settings { get; }

    /// <summary>
    /// 获取或设置转换中的额外参数
    /// </summary>
    /// <param name="key">参数键</param>
    object? this[string key] { get; set; }

    /// <summary>
    /// 创建新的上下文区域
    /// </summary>
    /// <param name="settings">新的设置</param>
    /// <param name="inherit">是否继承原设置</param>
    /// <returns></returns>
    IConvertContext Scope(IConvertSettings settings, bool inherit);
}
